package workers;

import javax.swing.SwingWorker;

import model.Software;
import workerUIs.StepFrame;

public abstract class AbstractStepSwingWorker extends
		SwingWorker<Software, Void> {

	protected Software software;
	protected final StepFrame frame;

	public AbstractStepSwingWorker(final StepFrame frame) {
		this.frame = frame;
	}

	public Software getSoftware() {
		return software;
	}

	public StepFrame getFrame() {
		return frame;
	}

	public void setSoftware(Software software) {
		this.software = software;
	}
	
	@Override
	protected void done() {
		String previousStepString = this.frame.getTextArea().getText();
		this.frame.getTextArea().setText(previousStepString + "\n--------------\n" + this.software.toString());
	}
}
